package com.avic.rong.userOrder.addressSelect;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import com.avic.rong.utils.SystemBarUtils;

/**
 * Created by Administrator on 16-2-1.
 */
public class KitkatRelativeLayout extends RelativeLayout {


    public KitkatRelativeLayout(Context context) {
        super(context);
        setInit();
    }

    public KitkatRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        setInit();
    }

    public KitkatRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setInit();
    }

    private void setInit() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//            setPadding(getPaddingLeft(),
//                    getPaddingTop() + SystemBarUtils.getStatusBarHeight(getContext()),
//                    getPaddingRight(),
//                    getPaddingBottom() + SystemBarUtils.getNavigationBarHeight(getContext()));

            setPadding(getPaddingLeft(),
                    getPaddingTop() + SystemBarUtils.getStatusBarHeight(getContext()),
                    getPaddingRight(),
                    getPaddingBottom());
        }
    }
}
